<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>关联开票信息统计</title>
<script>
	$(function(){
		var param = {pNo: '${param.pNo}',pNo_searchType:'eq'};
		/*列表初始化*/
		var gridParam = {
				url : '/console/com.fs.jzzn.pojo.Invoice/list',
				columns:[
				         [		
							{field:"invoiceNo",title:"单据编号", width:120,rowspan:2 }
							,{field:"pNo",title:"合同(路段)编号", width:120,rowspan:2 }
							,{field:"signNo",title:"外经证", width:100,rowspan:2  }
							,{title:"总包开票",colspan:8}    
							,{title:"分包开票",colspan:8}    
							,{field: "moneyNoRate", title: "不含税金额", width: 120,rowspan:2 }
					    	,{field: "moneyRate", title: "税额", width: 120,rowspan:2 }
					    	,{field: "remark", title: "备注", width: 120,rowspan:2}
					    	,{field : "department",width : 120,title: "关联项目部",rowspan:2}
							,{field : "createTime",width : 130,title: "创建时间",rowspan:2}
							,{field : "createrName",width : 130,title: "创建人",rowspan:2}
				     ],
				     [
						{field: "billTitle", title: "发票标题(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						,{field: "billNo", title: "开票编号(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						,{field: "billDate", title: "开票日期(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						 ,{field: "money", title: "开票金额(总)", width: 100,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						 ,{field: "billType", title: "发票类型(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						 ,{field: "taxRate", title: "税率(总)", width: 100,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
						 ,{field: "billName", title: "开票单位(总)", width: 80,styler: function(value,row,index){ return "background-color:#E6EEF8"; } }
						 ,{field: "operator", title: "经办人(总)", width: 80,styler: function(value,row,index){ return "background-color:#E6EEF8"; } }
						 
						 ,{field: "billTitleF", title: "发票标题(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						,{field: "billNoF", title: "开票编号(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						,{field: "billDateF", title: "开票日期(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						 ,{field: "moneyF", title: "开票金额(分)", width: 100,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						 ,{field: "billTypeF", title: "发票类型(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						 ,{field: "taxRateF", title: "税率(分)", width: 100,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						 ,{field: "billNameF", title: "开票单位(分)", width: 80,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
						 ,{field: "operatorF", title: "经办人(分)", width: 80,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}  
				     ]
			],
			queryParams: param ,
			onLoadSuccess:function(data){
				p.total({tip:'合计:', tipName:'signNo', fields:[{name:'money',total:'sum',tip:'合计:',tipName:'signNo'}] });
			},
			singleSelect : true
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend({}, p.dataGridParam, gridParam));

		/*事件响应*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "05":
					p.gridQuery();
					break;
				case "07":
					p.down({filename:'发票统计',url:'/console/invoice/export',local:true });
					break;
				default:
					break;
			}
		});
	});
</script>
</head>
<body>
	<div id="toolbar" style="padding:3px;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" motion_code="05">刷新</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-excel" plain="true" motion_code="07">导出</a>
	</div>
	<!-- 表格 -->
	<table id="dataGrid" style="height:100%;"></table>
</body>
</html>